/*
 * @Author: 李苏皖 onceseo@163.com
 * @Date: 2025-05-31 15:00:00
 * @LastEditors: 李苏皖 onceseo@163.com
 * @LastEditTime: 2025-06-01 23:28:16
 * @FilePath: \zygj-pc\vue.config.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const path = require('path');
const UglifyPlugin = require('uglifyjs-webpack-plugin');
function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
  productionSourceMap: false,
  publicPath: './',
  configureWebpack: {
    resolve: {
      extensions: ['.ts', '.tsx', '.js', '.json'],
      alias: {
        '@': resolve('src')
      }
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          loader: 'ts-loader',
          exclude: /node_modules/,
          options: {
            appendTsSuffixTo: [/\.vue$/]
          }
        }
      ]
    },
    optimization: {
      minimizer: [
        new UglifyPlugin({
          uglifyOptions: {
            warnings: false,
            compress: {
              drop_console: true,
              drop_debugger: false,
              pure_funcs: ['console.log']
            }
          }
        })
      ]
    }
  },
  // css: {
  //   loaderOptions: {
  //     postcss: {
  //       config: {
  //         path: './postcss.config.js'
  //       }
  //     }
  //   }
  // },
  devServer: {
    proxy: {
      '/': {
        // target: 'https://nature.xz.cn/orderPlusApi/',
        target: 'http://123.57.149.144',
        changeOrigin: true,
        ws: true
      }
    }
  }
};
